package test.db.table.mysql.type;

import test.db.table.Table;

/**
 * @author newbie
 * @since 0.1
 */
public enum PwLoginHistoryTable implements Table, ColumnType {
    SID(Column.sid),
    USER_SID(Column.userSid),
    INPUT_ID(Column.inputId),
    INPUT_PASSWD(Column.inputPasswd),
    ACTION_CODE(Column.actionCode),
    USER_IP(Column.userIp),
    REGIST_DATE(Column.registDate),
    REGIST_TIME(Column.registTime),
    REGIST_TIMESTAMP(Column.registTimestamp);
    
    private final Column column;
    private static final String TYPE_INPUT_ID = "VARCHAR(100)";
    private static final String TYPE_INPUT_PASSWD = "VARCHAR(72)";
    private static final String TYPE_ACTION_CODE = "VARCHAR(12)";

    PwLoginHistoryTable(Column column) {
        this.column = column;
    }
    
    private enum Column {
        sid {
            String getType() {
                return TYPE_SID;
            }
        },
        
        userSid {
            String getType() {
                return TYPE_USER_SID;
            }
        },

        inputId {
        	String getType() {
        		return TYPE_INPUT_ID;
        	}
        },
        
        inputPasswd {
        	String getType() {
        		return TYPE_INPUT_PASSWD;
        	}
        },
        
        actionCode {
        	String getType() {
        		return TYPE_ACTION_CODE;
        	}
        },
        
        userIp {
        	String getType() {
        		return TYPE_USER_IP;
        	}
        },

        registDate {
            String getType() {
                return TYPE_REGIST_DATE;
            }
        },
        
        registTime {
        	String getType() {
        		return TYPE_REGIST_TIME;
        	}
        },
        
        registTimestamp {
            String getType() {
                return TYPE_REGIST_TIMESTAMP;
            }
        };
        
        abstract String getType();
    }
    
    public String getType() {
        return column.getType();
    }
    
    public void initData() throws Exception {
    }
}